package com.lj.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.Date;

@Repository
public class LoginLogDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void creatLoginLog(String username){
        String sql = "INSERT INTO login_log(username, ip, login_time) VALUES(?,?,?)";
        Object[] args = {username, "127.0.0.1", new Date()};
        jdbcTemplate.update(sql, args);
    }
}
